const fp = require("lodash/fp");
const { Maybe } = require("./support");

const safeProp = fp.curry(function (x, o) {
  return Maybe.of(o[x]);
});

const user = { id: 2, name: "Albert" };

const ex3 = () => {
  return safeProp("name")(user).map(fp.flowRight(fp.first, Array.from))
};

console.log(ex3());
